package ch.sv7.tool.dbmanager.db.difference;

import ch.sv7.tool.dbmanager.db.ConstraintSchema;
import ch.sv7.tool.dbmanager.db.TableSchema;

public class MissingConstraintDifference extends AbstractTableDifference {

	private ConstraintSchema constraintSchema;

	public MissingConstraintDifference(TableSchema expectedTableSchema, TableSchema actualTableSchema, ConstraintSchema constraintSchema) {
		super(expectedTableSchema, actualTableSchema);
		this.constraintSchema = constraintSchema;
	}

	/**
	 * @return the constraintSchema
	 */
	public ConstraintSchema getConstraintSchema() {
		return constraintSchema;
	}


	public String getMessage() {
		return super.getMessage() 
			+ " constraint " 
			+ getConstraintSchema().getName() 
			+ " definition: " + getConstraintSchema().getDefinition()+ " is missing";
	}

	public boolean isBlocker() {
		return true;
	}	
	
}
